Skip to content

fix(portal): submit checkout payments with CSRF protection (v16) - #415

Open
Pandiyan5273 wants to merge 1 commit into
frappe:version-16from
Pandiyan5273:fix/checkout-payment-post
Open

Pandiyan5273 wants to merge 1 commit into
frappe:version-16from
Pandiyan5273:fix/checkout-payment-post

Conversation

@Pandiyan5273

@Pandiyan5273 Pandiyan5273 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Issue

Steps to replicate

  • Install Payments and Webshop v16, configure a gateway account, and enable checkout.
  • Link a website user with the Customer role to a customer and submit an unpaid order for that customer.
  • Sign in as that user, open the order page, and click Pay.
  • Open an invoice for 1,000 with 400 already paid and inspect the button amount.

Actual behavior

  • Pay uses GET and cannot reach the POST-only endpoint.
  • The partially paid invoice displays Pay 1,000 instead of the remaining 600.

Expected behavior

  • Pay sends a CSRF-protected POST for the remaining payable amount and redirects to the gateway.
  • Draft, cancelled, fully paid, and unauthorized documents do not offer Pay.

Backport needed

  • Version 16: Covered by this PR; the ERPNext customer-permission companion is required.
  • Version 15: Yes, by inspection at Webshop a355cdad44 and ERPNext d17086df9f. The same GET link and Desk-only permission path remain; coordinated adaptation and v15 runtime validation are still required.

Dependencies

@mergify

mergify Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant